<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page trimDirectiveWhitespaces="true" %> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>

<c:set var="ctx" value="${pageContext.request.contextPath}" />

<div id="container-fluid">
	<div class="col-lg-12">
		<p class="legend" style="text-align:center">修改用户信息</p>
		<form id="update-form" class="form-horizontal">
			<div class="form-group">
			<input type="hidden" id="uid" name="id" class="form-control required" value="${user.id }"/>				
			</div>
			<div class="form-group other">
				<label for="loginName" class="col-lg-2 control-label">登录名</label>
				<div class="col-lg-8">
					<input type="text" id="loginName" name="loginName" class="form-control required" value="${user.loginName }"/>
				</div>
			</div>
			<div class="form-group">
				<label for="name" class="col-lg-2 control-label">用户名</label>
				<div class="col-lg-8">
					<input type="text" id="name" name="name" class="form-control required" value="${user.name }"/>
				</div>
			</div>
			
			<div class="form-group">
				<label for="name" class="col-lg-2 control-label">角色</label>
				<div class="col-lg-8">
					<select name="rolesId" id="roles_select"></select>
				</div>
			</div>	
				
				<div class="form-group">		
					<label for="name" class="col-lg-2 control-label" >邮箱</label>
					<div class="col-lg-8"><input type="text" id="email" name="email" class="form-control required" value="${user.email }"/></div>
				</div>			
		
			<div class="form-group">
				<label for="lastName" class="col-lg-2 control-label">状态</label>
				<div class="col-lg-4">
					<div class="radio">
						<label class="radio"><input name="status" type="radio"
							value="open" <c:if test="${user.status == 'open'}">checked</c:if>>
							激活</label>
					</div>
					<div class="radio">
						<label class="radio"><input name="status" type="radio"
							value="locked"
							<c:if test="${user.status == 'locked'}">checked</c:if>>
							锁定</label>
					</div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-lg-offset-3">
					<button type="button" class="btn btn-primary add-submit">保存</button>
				</div>
			</div>
		</form>
	</div>
</div>

<c:if test="${env == 'production' }">
	<script type="text/javascript">
		seajs.use("${ctx}/assets/js-dist/admin/user-add-edit-page");
	</script>
</c:if>
<c:if test="${env != 'production' }">
	<script type="text/javascript">
		seajs.use("${ctx}/assets/js/admin/user-add-edit-page");
	</script>
</c:if>